/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.einstein.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Tobe
 */
@Embeddable
public class SaldoPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "ano_proc")
    private int anoProc;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "cod_prod")
    private String codProd;
    @Basic(optional = false)
    @NotNull
    @Column(name = "mes_proc")
    private int mesProc;
    @Basic(optional = false)
    @NotNull
    @Column(name = "compania_id")
    private int companiaId;

    public SaldoPK() {
    }

    public SaldoPK(int anoProc, String codProd, int mesProc, int companiaId) {
        this.anoProc = anoProc;
        this.codProd = codProd;
        this.mesProc = mesProc;
        this.companiaId = companiaId;
    }

    public int getAnoProc() {
        return anoProc;
    }

    public void setAnoProc(int anoProc) {
        this.anoProc = anoProc;
    }

    public String getCodProd() {
        return codProd;
    }

    public void setCodProd(String codProd) {
        this.codProd = codProd;
    }

    public int getMesProc() {
        return mesProc;
    }

    public void setMesProc(int mesProc) {
        this.mesProc = mesProc;
    }

    public int getCompaniaId() {
        return companiaId;
    }

    public void setCompaniaId(int companiaId) {
        this.companiaId = companiaId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) anoProc;
        hash += (codProd != null ? codProd.hashCode() : 0);
        hash += (int) mesProc;
        hash += (int) companiaId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SaldoPK)) {
            return false;
        }
        SaldoPK other = (SaldoPK) object;
        if (this.anoProc != other.anoProc) {
            return false;
        }
        if ((this.codProd == null && other.codProd != null) || (this.codProd != null && !this.codProd.equals(other.codProd))) {
            return false;
        }
        if (this.mesProc != other.mesProc) {
            return false;
        }
        if (this.companiaId != other.companiaId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.tesla.domain.SaldoPK[ anoProc=" + anoProc + ", codProd=" + codProd + ", mesProc=" + mesProc + ", companiaId=" + companiaId + " ]";
    }
    
}
